#include "Unbind.h"


Unbind::Unbind(char *id,char* passw,char *perm)
{
	identity=new char[strlen(id)+1];
	password=new char[strlen(passw)+1];
	permisiune=new char[strlen(perm)+1];
	if(identity==0 || password==0 || permisiune==0)
		throw new exception();
	strcpy(identity,id);
	strcpy(password,passw);
	strcpy(permisiune,perm);
}


Unbind::~Unbind(void)
{
	delete[] identity;
	delete[] permisiune;
	delete[] identity;
}

LDAP_Operation* Unbind::operate()
{
	result=new char[1000];
	strcpy(result,"unbind");
	strcat(result,"*");
	strcat(result,identity);
	strcat(result,"*");
	strcat(result,password);
	strcat(result,"*");
	strcat(result,permisiune);
	strcat(result,"***");

	LDAP_Operation *op=new Unbind((*this));
	return op;
}